//
//  NewStockDao.m
//  investevent
//
//  Created by jiangshao on 16/3/10.
//  Copyright © 2016年 com.scj.investevent. All rights reserved.
//

#import "NewStockDao.h"

@implementation NewStockDao

-(void)getNewStock{
    
    NSString *url=[NSString stringWithFormat: @"http://web.ifzq.gtimg.cn/stock/xingu/xgrl/xgql?type=all&page=1&psize=20&col=sgrq&order=desc"];
    AFHTTPSessionManager *session = [AFHTTPSessionManager manager];
    session.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];
    [session GET:url parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
        NSMutableDictionary *dict=[[NSMutableDictionary alloc]init];
        [dict setObject:responseObject forKey:@"getNewStock"];
        [self.remoteDaoDelegate getRemotedata:dict];
        NSLog(@"成功");
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        NSLog(@"失败");
        NSMutableDictionary *dict=[[NSMutableDictionary alloc]init];
        [dict setObject:@"getNewStock" forKey:Fail];
    }];
}

@end
